package itdfq.ydd.Creational_Pattern.SingletonPattern;

/**
 * @Author GocChin
 * @Date 2021/3/22 20:21
 * @Blog: itdfq.com
 * @QQ: 909256107
 */
public class VIPID {
    private static VIPID num = null;
    private String no;
    private VIPID(){}
    public static VIPID getInstance(){
        if (num == null){
            System.out.println("第一次办理会员，分配会员账号：");
            num=new VIPID();
            num.setVIPID("99999999");
        }else {
            System.out.println("已经办理过会员");
        }
        return num;
    }
    private void setVIPID(String no){
        this.no=no;
    }
    public String getVIPID(){
        return this.no;
    }
}
